<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="./jquery-3.6.0.min.js"></script>
    <script type="text/javascript">
        $(function() {

            $("#selectAll").click(function() {
                $("input[name='myCheck']").attr('checked', this.checked);
            });
        });
    </script>
</head>

<body>

    全选:<input id="selectAll" type="checkbox" /><br/> 游泳: <input type="checkbox" name="myCheck" /><br /> 吃饭: <input type="checkbox" name="myCheck" /><br /> 睡觉: <input type="checkbox" name="myCheck" /><br /> 跳舞: <input type="checkbox" name="myCheck" /><br
    />

</body>

</html>